<%--
  Created by IntelliJ IDEA.
  User: wwh
  Date: 2017/7/31
  Time: 15:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page import="java.util.Date" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>创建系部专业班级</title>
    <link rel="stylesheet" href="../../static/common/layui/css/layui.css">
    <link rel="stylesheet" href="../../static/css/global.css">
    <link rel="stylesheet" href="../../static/css/table.css">
    <link rel="stylesheet" href="../../static/common/jquery-treetable/css/jquery.treetable.css" />
    <link rel="stylesheet" href="../../static/common/jquery-treetable/css/jquery.treetable.theme.default.css" />
    <% long now = new Date().getTime();
        request.setAttribute("now", now); %>
</head>
<body>
<div style="margin:15px;" id="Vue">
    <blockquote class="layui-elem-quote">
        <a href="#" class="layui-btn layui-btn-small" @click="addDepartment">
            <i class="layui-icon">&#xe608;</i> 添加系部
        </a>
        <a href="#" class="layui-btn layui-btn-small" @click="addMajor">
            <i class="layui-icon">&#xe608;</i> 添加专业
        </a>
        <a href="#" class="layui-btn layui-btn-small" @click="addClass">
            <i class="layui-icon">&#xe608;</i> 添加班级
        </a>
    </blockquote>
    <fieldset class="layui-elem-field">
        <legend>系部专业班级信息</legend>
        <div class="layui-field-box layui-form">
            <table class="layui-table admin-table" id="example-basic">
                <thead>
                    <tr>
                        <th>系部/专业/班级</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <%--内容容器--%>
                <tbody id="content">
                </tbody>
            </table>
        </div>
    </fieldset>
    <%--分页容器--%>
    <div class="admin-table-page">
        <div id="paged" class="page">
        </div>
    </div>
</div>
<script>
    var userId = ${sessionScope.currentUser.getId()};
    var schoolId = '';
//    console.log(userId);
</script>
<!--模板-->
<script type="text/html" id="tpl">
    {{# layui.each(d.data,function(index,item){ }}

    <tr data-node-id="school+{{item.department.id}}">
        <td >{{item.department.name}}</td>
        <td>
            <a href="javascript:;" target="_blank" data-id="{{item.department.id}}" data-opt="update" class="layui-btn layui-btn-mini">修改</a>
            <a href="javascript:;" target="_blank" data-id="{{item.department.id}}" data-opt="delete" class="layui-btn layui-btn-danger layui-btn-mini">删除</a>
        </td>
    </tr>
    {{# layui.each(item.majorList,function(index,item2){  }}
    <tr data-node-id="major+{{item2.major.id}}" data-parent-id="school+{{item2.major.departmentid}}">
        <td >{{item2.major.name}}</td>
        <td>
            <a href="javascript:;" target="_blank" data-id="{{item2.major.id}}" data-opt="update" class="layui-btn layui-btn-mini">修改</a>
            <a href="javascript:;" target="_blank" data-id="{{item2.major.id}}" data-opt="delete" class="layui-btn layui-btn-danger layui-btn-mini">删除</a>
        </td>
    </tr>
    {{# layui.each(item2.classList,function(index,clazz){ }}
    <tr data-node-id=""  data-parent-id="major+{{item2.major.id}}">
        <td  >{{ clazz.name }}</td>
        <td>
            <a href="javascript:;" target="_blank" data-id="{{clazz.id}}" data-opt="update" class="layui-btn layui-btn-mini">修改</a>
            <a href="javascript:;" target="_blank" data-id="{{clazz.id}}" data-opt="delete" class="layui-btn layui-btn-danger layui-btn-mini">删除</a>
        </td>
    </tr>
    {{# }); }}
    {{#});}}
    {{#});}}
</script>
<script src="../../static/common/axios.min.js"></script>
<script src="../../static/common/vue.min.js"></script>
<script src="../../static/common/layui/layui.js"></script>
<script type="text/javascript" src="../../static/common/jquery/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../../static/common/jquery-treetable/jquery.treetable.js"></script>
<script src="../../static/js/schoolAdmin/departmentMajorClass.js"></script>
</body>
</html>
